/**
 * 
 */
package com.jinmei.jerplogin;

import org.w3c.dom.Node;

import com.jinmei.remote.response.BaseResponse;
import com.jinmei.remote.util.XMLUtils;

//import com.jinmei.mail.util.JSONUtils;

/**
 * @author richard
 *
 */
public class JERPLoginResponse extends BaseResponse {
	
	@Override
	protected void setBody(String body) throws Exception {
		this.body = body;
	}
	
	public String getLoginStatus() {
		Node loginStatus = XMLUtils.getNodeByTagName(this.body, "code");
		if (loginStatus != null) {
			return loginStatus.getTextContent();
		}
		return null;
    }
	
	public String getSessionId() {
		Node session = XMLUtils.getNodeByTagName(this.body, "session");
		if (session != null) {
			return session.getTextContent();
		}
		return null;
    }
	
	public String getLoginMsg() {
		Node loginMsg = XMLUtils.getNodeByTagName(this.body, "message");
		if (loginMsg != null) {
			return loginMsg.getTextContent();
		}
		return null;
    }
    
}
